﻿#include "stdafx.h"
#include <wincrypt.h>
#include "utils\Debug.h"
#include "main_type_c.h"

void printBinary(void* data, int dataLen, const char* tag)
{
    DWORD bufLen = dataLen * 6 + 100;
    char* buf = new char[bufLen + 1];
    if (CryptBinaryToString((const BYTE*)data, dataLen, CRYPT_STRING_HEXASCII, buf, &bufLen)) {
        buf[bufLen] = 0;
        if (tag && strlen(tag))
            OutputDebugString(tag);
        OutputDebugString(buf);
        //gamePrintLog("", buf, 4);
    }
    delete[] buf;
}
